package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IProductSupplierDao;
import com.financing.platform.dto.ProductSupplierDTO;
import com.financing.platform.util.SqlName;

@Repository("productSupplierDao")
public class ProductSupplierDaoImpl extends BaseDaoImpl implements IProductSupplierDao {

	@Override
	public int addProductSupplier(ProductSupplierDTO productSupplierDto) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.addProductSupplier,productSupplierDto);
	}

	@Override
	public List<ProductSupplierDTO> queryProductSupplier(
			ProductSupplierDTO productSupplierDto) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryProductSupplier,productSupplierDto);
	}

	@Override
	public int editProductSupplier(Map map)
			throws SQLException {
		return this.sqlMapClient.update(SqlName.updateProductSupplier,map);
	}

	@Override
	public int queryProductSupplierCount(ProductSupplierDTO productSupplierDto)
			throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.queryProductSupplierCount,productSupplierDto);
	}

	@Override
	public ProductSupplierDTO queryProductSupplierInfo(
			ProductSupplierDTO productSupplierDto) throws SQLException {
		return (ProductSupplierDTO) this.sqlMapClient.queryForObject(SqlName.queryProductSupplierInfo,productSupplierDto);
	}

	@Override
	public List<Map<String, Object>> queryProductSupplierInfoEmail()
			throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryProductSupplierInfoEmail);
	}

	@Override
	public List<Map<String, Object>> queryProductSupplierEmailById(String id)
			throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryProductSupplierEmailById,id);
	}

	
}
